package com.sky.config;
import com.sky.properties.AliOssProperties;
import com.sky.utils.AliOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @author 符健清
 * @version 1.0
 */
@SuppressWarnings({"all"})
@Component
@ConfigurationProperties
@Slf4j
public class AliyunOSSUtilsDisposition {

    @Bean
    public AliOssUtil aliyOSSUtils (AliOssProperties  aliOssProperties){
        log.info("AliOssUtil 配置完成");
         return new AliOssUtil(aliOssProperties.getEndpoint(),
                 aliOssProperties.getAccessKeyId(),
                 aliOssProperties.getAccessKeySecret(),
                 aliOssProperties.getBucketName());
    }
}
